<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import = "shop.coffeeshop.master.ShopCoffeeDBBean" %>
<%@ page import = "shop.coffeeshop.master.ShopCoffeeDataBean" %>
<%@ page import  = "java.util.List" %>
<%@ page import = "java.text.NumberFormat" %>

<%@ include file="../etc/color.jspf" %>

<%
String coffee_kind = request.getParameter("coffee_kind");
%>

<html>
<head>
<title>CoffeeKong Shopping Mall</title>
<link href="../etc/style.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="<%=bodyback_c%>">
<table>
<tr>
<td width="150" valign="top">
<jsp:include page="../module/left.jsp" flush="false"/>
</td>
<td width="700">

<%
List<ShopCoffeeDataBean> coffeeLists = null;
ShopCoffeeDataBean coffeeList = null;
String coffee_kindName="";

ShopCoffeeDBBean coffeeProcess = ShopCoffeeDBBean.getInstance();

coffeeLists = coffeeProcess.getCoffee(coffee_kind);
if(coffee_kind.equals("100"))
	coffee_kindName="원두";
else if(coffee_kind.equals("200"))
	coffee_kindName="텀블러";
else if(coffee_kind.equals("300"))
	coffee_kindName="기타";
else if(coffee_kind.equals("all"))
	coffee_kindName="전체";
%>

<h3><b><%=coffee_kindName %>분류목록</b></h3>
<a href="shopMain.jsp">메인으로</a>
<%
for(int i=0;i<coffeeLists.size();i++){
	coffeeList = (ShopCoffeeDataBean)coffeeLists.get(i);
%>
<table>

<tr height="30" bgcolor="<%=value_c %>">
<td rowspan="4" width="100">
<a href="coffeeContent.jsp?coffee_id=<%=coffeeList.getCoffee_id()%>&coffee_kind=<%=coffee_kind %>">
<img src="../../imageFile/<%=coffeeList.getCoffee_image()%>"border="0" width="60" height="90">
</a>
</td>
<td width="350"><font size="+1"><b>
<a href="coffeeContent.jsp?coffee_id=<%=coffeeList.getCoffee_id()%>&coffee_kind=<%=coffee_kind%>">
<%=coffeeList.getCoffee_title() %></a></b></font></td>
<td rowspan="4" width="100" align="center" valign="middle">
<%if(coffeeList.getCoffee_count()==0){ %>
<b>임시품절</b>
<%}else{ %>
&nbsp;
<%} %>
</td>
</tr>

<tr height="30" bgcolor="<%=value_c%>">
<td width="350">제조사:<%=coffeeList.getPublishing_com() %></td>
</tr>

<tr height="30" bgcolor="<%=value_c%>"> 
<td width="350">원산지:<%=coffeeList.getAuthor() %></td>
</tr>

<tr height="30" bgcolor="<%=value_c%>">
<td width="350">정가:
<%=NumberFormat.getInstance().format(coffeeList.getCoffee_price()) %><br>
판매가:<b><font color="red">
<%=NumberFormat.getInstance().format((int)(coffeeList.getCoffee_price()*((double)(100-coffeeList.getDiscount_rate())/100))) %>
</font></b></td>
</tr>
</table>
<br>
<%
}
%>
</td>
</tr>
</table>
</body>
</html>